package com.foreveross.proxyip.monitor.vo;

import java.util.Date;

import com.foreveross.proxyip.infra.utils.DateUtils;

public class RetrieveIpEntityVO {
	
//	public final static SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
	
	
	/**
	 * 下面字段只要是字符串均可作为数据库查询条件，如果字符串不为"",则表示有此条件
	 */
	private String id;
	private String area;
	private String createTimeStr;//创建时间的字符串
	private Date createTime;//创建时间
	private String ip;
	private String portStr;//端口的字符串
	private Integer port;//端口
	private Integer responseTime;//响应时间
	private String responseTimeStr;//响应时间的字符串
	private Date retrieveTime;//取回时间
	private String retrieveTimeStr;//取回时间的字符串
	
	private String stateStr;//状态的字符串
	private Integer state;//状态
	private String beforeSearchMinuteStr;//检索时间（XX分钟之前）
	private String retrieveChannel;//渠道
	private String retrieveChannelName;//渠道中文名称
	
	
	public RetrieveIpEntityVO(){}
	
	/**
	 * 这个构造方法会根据日期格式填充响应的字符串
	 * @param id
	 * @param area
	 * @param createTime
	 * @param ip
	 * @param port
	 * @param responseTime
	 * @param retrieveTime
	 * @param state
	 * @param retrieveChannel
	 */
	public RetrieveIpEntityVO(String id, String area, Date createTime,
			String ip, Integer port, Integer responseTime, Date retrieveTime,
			Integer state, String retrieveChannel,String retrieveChannelName) {
		super();
		this.id = id;
		this.area = area;
		this.createTime = createTime;
		this.createTimeStr=this.generateDateStr(this.createTime);
		this.ip = ip;
		this.port = port;
		this.portStr=this.port+"";
		this.responseTime = responseTime;
		this.responseTimeStr=this.responseTime+"";
		this.retrieveTime = retrieveTime;
		this.retrieveTimeStr=this.generateDateStr(this.retrieveTime);
		this.state = state;
		this.stateStr=this.state+"";
		this.retrieveChannel = retrieveChannel;
		this.retrieveChannelName=retrieveChannelName;
	}


	private String generateDateStr(Date date){
		
		return date==null?"":DateUtils.DATE_FMT_CN_BARS_YMD_HMS.format(date);
	}








	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getArea() {
		return area;
	}
	public void setArea(String area) {
		this.area = area;
	}
	public String getCreateTimeStr() {
		return createTimeStr;
	}
	public void setCreateTimeStr(String createTimeStr) {
		this.createTimeStr = createTimeStr;
	}
	
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getRetrieveChannel() {
		return retrieveChannel;
	}
	public void setRetrieveChannel(String retrieveChannel) {
		this.retrieveChannel = retrieveChannel;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public String getPortStr() {
		return portStr;
	}
	public void setPortStr(String portStr) {
		this.portStr = portStr;
	}
	public Integer getPort() {
		return port;
	}
	public void setPort(Integer port) {
		this.port = port;
	}
	public Integer getResponseTime() {
		return responseTime;
	}
	public void setResponseTime(Integer responseTime) {
		this.responseTime = responseTime;
	}
	public String getRetrieveTimeStr() {
		return retrieveTimeStr;
	}
	public void setRetrieveTimeStr(String retrieveTimeStr) {
		this.retrieveTimeStr = retrieveTimeStr;
	}
	public Date getRetrieveTime() {
		return retrieveTime;
	}
	public void setRetrieveTime(Date retrieveTime) {
		this.retrieveTime = retrieveTime;
	}
	public String getStateStr() {
		return stateStr;
	}
	public void setStateStr(String stateStr) {
		this.stateStr = stateStr;
	}
	public Integer getState() {
		return state;
	}
	public void setState(Integer state) {
		this.state = state;
	}
	public String getBeforeSearchMinuteStr() {
		return beforeSearchMinuteStr;
	}
	public void setBeforeSearchMinuteStr(String beforeSearchMinuteStr) {
		this.beforeSearchMinuteStr = beforeSearchMinuteStr;
	}

	public String getResponseTimeStr() {
		return responseTimeStr;
	}

	public void setResponseTimeStr(String responseTimeStr) {
		this.responseTimeStr = responseTimeStr;
	}

	public String getRetrieveChannelName() {
		return retrieveChannelName;
	}

	public void setRetrieveChannelName(String retrieveChannelName) {
		this.retrieveChannelName = retrieveChannelName;
	}
	
	
	
	
	
	
}
